package com.ssy.lingxi.member.merchant.model.bo;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
 * AuthBO中的按钮
 * @author 万宁
 * @version 2.0.0
 * @date 2022-02-10
 */
public class ButtonBO implements Serializable {
    private static final long serialVersionUID = -2485820726923066929L;

    public ButtonBO() {}

    public ButtonBO(Long buttonId, String title, String url, String code, Map<String, Object> attrs) {
        this.buttonId = buttonId;
        this.title = title;
        this.url = url;
        this.code = code;
        this.attrs = attrs == null ? new HashMap<>() : attrs;
    }

    /**
     * 按钮Id
     */
    private Long buttonId;

    /**
     * 按钮名称
     */
    private String title;

    /**
     * 按钮Url（备用）
     */
    private String url;

    /**
     * 按钮编码
     */
    private String code;

    /**
     * 按钮属性
     */
    private Map<String, Object> attrs;

    public Long getButtonId() {
        return buttonId;
    }

    public void setButtonId(Long buttonId) {
        this.buttonId = buttonId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Map<String, Object> getAttrs() {
        return attrs;
    }

    public void setAttrs(Map<String, Object> attrs) {
        this.attrs = attrs;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }

        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        ButtonBO button = (ButtonBO) o;
        return buttonId.equals(button.buttonId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(buttonId);
    }
}
